package com.nf.db.handlers.property;

import com.nf.db.handlers.PropertyHandler;

import java.time.LocalDate;
import java.sql.Date;

/*
 * PropertyHandler的实现类，用于处理LocalDate类型属性的读写
 * */
public class LocalDatePropertyHandler implements PropertyHandler {
    @Override
    public Object Parse(Date date) {
        return date.toLocalDate();
    }

    @Override
    public Boolean match(Class<?> beanFieldClz, Object value) {
        return value instanceof Date && beanFieldClz == LocalDate.class;
    }
}
